<?php
$opt = getopt('h:p:');

$conf = '';
include 'db.php';
include 'env/env.php';
include 'env/single.php';
if(isset($opt['h'])){
    $conf['server']['host'] = $opt['h'];
}
if(isset($opt['p'])){
    $conf['server']['port'] = $opt['p'];
}
define('DIR', __DIR__);
define('APP_NAME', 'single');

// 引入主类
require_once 'lib/SwooleServer.php';

// 创建服务器实例并启动
$server = new SwooleServer($conf);
$server->start();